package com.shop.service;

import java.util.List;

import com.shop.dao.goodsDaoI;
import com.shop.dao.goodsDaoImpl;
import com.shop.entity.goods;
/**
 * 
 * @类名 goodsServiceImpl
 * @描述   业务层
 * @作者： 李健玖
 * @日期：2018年6月30日下午2:17:28
 */
public class goodsServiceImpl implements goodsServiceI{
	
	private static goodsDaoI goi=new goodsDaoImpl();
	
	@Override
	public boolean add(goods goods) throws Exception {
		
		List<goods> list=goi.selectWhere("and goods='"+goods.getGname()+"'");
		if(list.size()>0){
			return false;
		}
		return goi.insert(goods);
	}

	@Override
	public boolean remove(int Goods) throws Exception {
		// TODO Auto-generated method stub
		return goi.delete(Goods);
	}

	@Override
	public boolean modify(goods goods) throws Exception {
		
		return goi.update(goods);
	}

	@Override
	public List<goods> findByAll() throws Exception {
		
		return goi.selectAll();
	}

}
